/**
 * Copyright 2016 SAIC General Motors Corporation Ltd. All Rights Reserved.
 *
 * This software is published under the terms of the SGM Software
 * License version 1.0, a copy of which has been included with this
 * distribution in the LICENSE.txt file.
 *
 * @Project Name : spring-aop
 *
 * @File name : AspectTest.java
 *
 * @Author : chen
 *
 * @Date : 2016��12��21��
 *----------------------------------------------------------------------------------
 *     Date       Who       Version     Comments
 * 1. 2016��12��21��    chen    1.0
 *
 *
 *
 *----------------------------------------------------------------------------------
 */
package org.chw.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/*
* 切面
* */
@Component
@Aspect
public class AspectTest {
    //切点
    @Pointcut("execution(* org.chw.dao.DaoTest.say(..))")
    private void anyMethod() {
    }
    /*
     * @Before("anyMethod()") public void doAccessCheck(){
     * System.out.println("hah"); }
     */

    //֪ͨ环绕方法-Around
    @Around("anyMethod()")
    public String around(ProceedingJoinPoint pjp) throws Throwable {
        if (true) {
            return "no";
        }
        String s = (String) pjp.proceed();
        return s;
    }
}
